/*   
    Copyright (C) 2009 Galaktika Corporation ZAO

    This file is a part of Galaktika.BusinessMonitor
 
    Galaktika.BusinessMonitor is a free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
      
    You should have received a copy of the GNU General Public License
    along with Galaktika.BusinessMonitor.  If not, see <http://www.gnu.org/licenses/>.
  
    If GPL v.3 is not suitable for your products or company,
    Galaktika Corp provides Galaktika.BusinessMonitor under a flexible commercial license
    designed to meet your specific usage and distribution requirements.
    If you have already obtained a commercial license from Galaktika Corp,
    you can use this file under those license terms.
*/

using System;
using System.Collections.Generic;
using System.Reflection;

namespace Galaktika.BI.Runtime.Services
{
    /// <summary>
    /// Represents application manager.
    /// </summary>
    public interface IAppManager
    {
        /// <summary>
        /// Gets current active form. 
        /// Returns null if there is no opened forms.
        /// Form is an instance of <see cref="Galaktika.BI.Runtime.Services.IBrickContainerHolder"/>.
        /// </summary>
        object CurrentForm { get; }

        /// <summary>
        /// Occurs when current form changed.
        /// </summary>
        event EventHandler CurrentFormChanged;

        /// <summary>
        /// Occurs when current view state can be saved.
        /// </summary>
        event EventHandler SaveCurrentState;

        /// <summary>
        /// Occurs wher current view state can be loaded.
        /// </summary>
        event EventHandler LoadCurrentState;

        /// <summary>
        /// Upadate current view state.
        /// </summary>
        void UpdateCurrentContext();

        /// <summary>
        /// Update navigation bar.
        /// </summary>
        void UpdateNavigationBar();

        /// <summary>
        /// Reset form.
        /// </summary>
        void ResetForm();

        /// <summary>
        /// Gets an owner 
        /// </summary>
        object Owner { get; }

        /// <summary>
        /// Gets application title.
        /// </summary>
        /// <returns></returns>
        string GetAppTitle();

        /// <summary>
        /// Gets client assembly.
        /// </summary>
        Assembly ClientAssembly { get; }

        /// <summary>
        /// Reserved for future.
        /// </summary>
        /// <param name="container"></param>
        /// <param name="root"></param>
        void AttachHelp(IBrickContainer container, object root);
    }

    //public interface IHelpService
    //{
    //    Form CurrentForm { get; }
    //    void UpdateCurrentContext();
    //    WorkDescriptor StartWork(string name, int workScope);
    //    void ProcessWork(WorkDescriptor descriptor);
    //    void StopWork(WorkDescriptor descriptor);
    //    IWin32Window Owner { get; }
    //}

    //public class WorkDescriptor
    //{
    //    public WorkDescriptor(string name, int workScope)
    //    {
    //        this.Name = name;
    //        this.Scope = workScope;
    //    }

    //    public readonly string Name;
    //    public readonly int Scope;
    //    public int Current = 0;
    //}
}
